# __author: iamironman
from rest_framework import serializers
from .models import Order, OrderDetail


class OrderCourseSerializer(serializers.ModelSerializer):
    class Meta:
        model = OrderDetail
        fields = ('course_name', 'expire_text', 'price', 'real_price', 'discount_name', 'course_img')


class OrderDetailModelSerializer(serializers.ModelSerializer):
    order_courses = OrderCourseSerializer(many=True)

    class Meta:
        model = Order
        fields = ('id', 'total_price', 'real_price', 'pay_type', 'use_coupon', 'coupon', 'order_courses')
